<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="app">
    <div @click="aaa">
        aaaaa
<!--        stop停止点击，貌似测试失败了 -->
        <button @click.stop="add">+</button>
    </div>
    <br>
    <form actiom="baidu">
<!--        prevent 不会跳界面-->
        <input type="submit" value="提交" @click.prevent="submitBtn">
    </form>
    <button @click="sub">-</button>
<!--    .enter不监听键盘事件 -->
    <input type="text" @keyup.enter="keyUp">

<!--    .once只调用一次-->
    <button @click.once="onceBtn"> once </button>
</div>

<script src="../js/vue.js"></script>
<script>
     const app = new Vue({
        el: '#app',
        data: {
            message: 'hello xw',
            name: 'hello vue',
            movies: ['西游记','红楼梦','水浒传','三国演义'],
            counter: 0
        },
        methods: {
            add: function () {
                console.log('add被执行');
            },
            sub: function () {
                console.log('sub被执行');
            },
            aaa () {
                console.log('aaa');
            },
            submitBtn () {
                console.log('submitBtn');
            },
            keyUp () {
                console.log('keyUp');
            },
            onceBtn () {
                console.log('keyUp');
            }
        }
    })
</script>

</body>
</html>